reservations-eapi icon

reservations-eapi

(0 reviews)

Availability - Basic Usage

This page provides an example of the simplest type of availability searching. It is intended to be a starter example for people unfamiliar with availability and/or the reservation interface to understand the basic concepts before moving on to more complex, real-world, examples.

Below is an example availability request for one product (SVS, 00000) for one adult (000) passenger who is looking to travel on 9th March between Chelmsford (6836) and Manchester Piccadilly (2968). This journey has 3 legs (Chelmsford to London Liverpool Street, London Liverpool Street to London Euston and London Euston (EUS) to Manchester Piccadilly (MAN)) but only the final leg on an Avanti West Coast train (VT707000) allows reservations to be made.

Request:

{
   "salesFlowType": "SALES",
   "journeys": [
      {
         "id": "journey_1",
         "direction": "outbound",
         "journeyConditions": {
            "journeyOD": {
               "journeyOrigin": "6836",
               "journeyDestination": "2968"
            }
         },
         "legs": [
            {
               "id": "segment_1",
               "boardLocation": "EUS",
               "alightLocation": "MAN",
               "rsid": "VT123400",
               "serviceOriginDate": "2021-03-09"
            }
         ],
         "bundles": [
            {
               "id": "bundle_1",
               "products": [
                  {
                     "ticketTypeCode": "SVS",
                     "routeCode": "00000"
                  }
               ]
            }
         ]
      }
   ],
   "passengers": [
      {
         "id": "passenger_1",
         "statusCode": "000"
      }
   ]
}

Response, Example 1 - product is available:

This response to this request indicates that this product is available for this passenger (FULL_AVAILABILITY) on the requested service. In addition to confirming availability it also provides information about the requested service and product:

Information:

  • Inventory Class associated to the product (2C)
  • Departure timestamp for the board location on the reservable leg (2021-03-09T10:20:00+00:00)
  • Arrival timestamp for the alight location on the reservable leg (2021-03-09T12:28:00+00:00)
  • Carrier code for the reservable leg (VT)

The response also includes data which the consumer will need if they move forward to make a booking:

  • Tariff code associated to the product for this service (2O_SVS)
  • Service identifier, a unique string used to identify a service when executing a booking (0:R|VT123400|TRAIN|2021-03-09)
{
   "salesFlowType": "SALES",
   "journeys": [
      {
         "journeyConditions": {
            "journeyOD": {
               "journeyDestination": "2968",
               "journeyOrigin": "6836"
            }
         },
         "bundles": [
            {
               "bundleOutcome": "FULL_AVAILABILITY",
               "products": [
                  {
                     "ticketTypeCode": "SVS",
                     "items": [
                        {
                           "inventoryClass": "2C",
                           "passengerIds": [
                              "passenger_1"
                           ],
                           "legId": "segment_1",
                           "tariffCode": "2O_SVS"
                        }
                     ],
                     "routeCode": "00000"
                  }
               ],
               "id": "bundle_1"
            }
         ],
         "direction": "outbound",
         "id": "journey_1",
         "legs": [
            {
               "arrivalDateTime": "2021-03-09T12:28:00+00:00",
               "departureDateTime": "2021-03-09T10:20:00+00:00",
               "alightLocation": "MAN",
               "boardLocation": "EUS",
               "id": "segment_1",
               "serviceOriginDate": "2021-03-09",
               "serviceIdentifier": "0:R|VT123400|TRAIN|2021-03-09",
               "rsid": "VT707000",
               "carrierCode": "VT"
            }
         ]
      }
   ],
   "passengers": [
      {
         "id": "passenger_1",
         "statusCode": "000"
      }
   ]
}

Response, Example 2 - product is NOT available:

This example shows how the response would look if the requested product isn't available for booking on the requested service. -

  • If the product's terms and conditions include mandatory reservation this response means the ticket cannot be sold for travel on this service.
  • If the product's terms and conditions are for optional reservations then it is still possible to sell this ticket for this service but a seat cannot be booked
{
   "salesFlowType": "SALES",
   "journeys": [
      {
         "journeyConditions": {
            "journeyOD": {
               "journeyDestination": "2968",
               "journeyOrigin": "6836"
            }
         },
         "bundles": [
            {
               "bundleOutcome": "NO_AVAILABILITY",
               "id": "bundle_1"
            }
         ],
         "direction": "outbound",
         "id": "journey_1",
         "legs": [
            {
               "arrivalDateTime": "2021-03-09T12:28:00+00:00",
               "departureDateTime": "2021-03-09T10:20:00+00:00",
               "alightLocation": "MAN",
               "boardLocation": "EUS",
               "id": "segment_1",
               "serviceOriginDate": "2021-03-09",
               "serviceIdentifier": "0:R|VT123400|TRAIN|2021-03-09",
               "rsid": "VT707000",
               "carrierCode": "VT"
            }
         ]
      }
   ],
   "passengers": [
      {
         "id": "passenger_1",
         "statusCode": "000"
      }
   ]
}

To request updates to this text please contact Neil Barkham.


Reviews